package com.xhcl.web.controller.system;

import java.util.List;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.xhcl.common.annotation.Log;
import com.xhcl.common.core.controller.BaseController;
import com.xhcl.common.core.domain.AjaxResult;
import com.xhcl.common.core.page.TableDataInfo;
import com.xhcl.common.enums.BusinessType;
import com.xhcl.framework.uitls.poi.ExcelUtil;
import com.xhcl.system.domain.TSrhsJtmx;
import com.xhcl.system.service.ITGgKmdmService;
import com.xhcl.system.service.ITSrhsHsxtcsService;
import com.xhcl.system.service.ITSrhsJtmxService;
import com.xhcl.system.service.ITSrhsPztoService;

/**
 * 辅助明细账
 * 
 * @author xhcl
 * @date 2020-09-02
 */
@Controller
@RequestMapping("/system/lszaccount")
public class TSrhsLszAccountController extends BaseController
{
    private String prefix = "system/lszaccount";

    @Autowired
    private ITSrhsJtmxService tSrhsJtmxService;

    @RequiresPermissions("system:lszaccount:view")
    @GetMapping()
    public String lszaccount(ModelMap mmap)
    {   
        return prefix + "/lszaccount";
    }

    /**
     * 查询
     */
    @RequiresPermissions("system:lszaccount:list")
    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo list(TSrhsJtmx tSrhsJtmx)
    {  
    	List<TSrhsJtmx> list= tSrhsJtmxService.selectTSrhsJtmxLszList(tSrhsJtmx);
        return getDataTable(list);
    }

    /**
     * 导出列表
     */
    @RequiresPermissions("system:lszaccount:export")
    @Log(title = "流水账", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    @ResponseBody
    public AjaxResult export(TSrhsJtmx tSrhsJtmx)
    {   
    	List<TSrhsJtmx> list= tSrhsJtmxService.selectTSrhsJtmxLszList(tSrhsJtmx);
        ExcelUtil<TSrhsJtmx> util = new ExcelUtil<TSrhsJtmx>(TSrhsJtmx.class);
        return util.exportExcel(list, "lsz");
    }

     
}
